/**
 * grayrabbit Inc.
 * Copyright (c) 2011-2012 All Rights Reserved.
 */
package com.grayrabbit.slacker.config;

import java.util.List;
import java.util.Map;

/**
 * 生成任务对应属性
 * 
 * @author liyd
 * @version $Id: GenerateConfig.java, v 0.1 2012-5-9 上午10:03:31 liyd Exp $
 */
public class GenerateConfig {

    /** 任务名称 */
    private String                generateName;

    /** 表名 */
    private String                tableName;

    /** 处理类名 */
    private String                clazz;

    /** 是否替换已有文件标识 true替换 */
    private Boolean               replace;

    /** 任务各配置属性集合 */
    private Map<String, Property> properties;

    /** 表包含的列 默认三个数组元素 0类型 1列名 2列备注 自己实现数据库查询时可变*/
    private List<String[]>        columns;

    /** 生成文件路径 不指定时根据xml默认生成 指定时按此路径生成 */
    private String                targetFilePath;

    /**
     * 获取接口
     * 
     * @param generateType
     * @return
     */
    public String getGenerateClass(String generateType) {

        return Configuration.getClass(this.tableName + generateType);

    }

    /**
     * Getter method for property <tt>generateName</tt>.
     * 
     * @return property value of generateName
     */
    public String getGenerateName() {
        return generateName;
    }

    /**
     * Setter method for property <tt>generateName</tt>.
     * 
     * @param generateName value to be assigned to property generateName
     */
    public void setGenerateName(String generateName) {
        this.generateName = generateName;
    }

    /**
     * Getter method for property <tt>tableName</tt>.
     * 
     * @return property value of tableName
     */
    public String getTableName() {
        return tableName;
    }

    /**
     * Setter method for property <tt>tableName</tt>.
     * 
     * @param tableName value to be assigned to property tableName
     */
    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    /**
     * Getter method for property <tt>clazz</tt>.
     * 
     * @return property value of clazz
     */
    public String getClazz() {
        return clazz;
    }

    /**
     * Setter method for property <tt>clazz</tt>.
     * 
     * @param clazz value to be assigned to property clazz
     */
    public void setClazz(String clazz) {
        this.clazz = clazz;
    }

    /**
     * Getter method for property <tt>replace</tt>.
     * 
     * @return property value of replace
     */
    public Boolean getReplace() {
        return replace;
    }

    /**
     * Setter method for property <tt>replace</tt>.
     * 
     * @param replace value to be assigned to property replace
     */
    public void setReplace(Boolean replace) {
        this.replace = replace;
    }

    /**
     * Getter method for property <tt>properties</tt>.
     * 
     * @return property value of properties
     */
    public Map<String, Property> getProperties() {
        return properties;
    }

    /**
     * Setter method for property <tt>properties</tt>.
     * 
     * @param properties value to be assigned to property properties
     */
    public void setProperties(Map<String, Property> properties) {
        this.properties = properties;
    }

    /**
     * Getter method for property <tt>columns</tt>.
     * 
     * @return property value of columns
     */
    public List<String[]> getColumns() {
        return columns;
    }

    /**
     * Setter method for property <tt>columns</tt>.
     * 
     * @param columns value to be assigned to property columns
     */
    public void setColumns(List<String[]> columns) {
        this.columns = columns;
    }

    /**
     * Getter method for property <tt>targetFilePath</tt>.
     * 
     * @return property value of targetFilePath
     */
    public String getTargetFilePath() {
        return targetFilePath;
    }

    /**
     * Setter method for property <tt>targetFilePath</tt>.
     * 
     * @param targetFilePath value to be assigned to property targetFilePath
     */
    public void setTargetFilePath(String targetFilePath) {
        this.targetFilePath = targetFilePath;
    }

}
